package authoritah.db;

import java.sql.Connection;
import java.sql.DriverManager;

public class ParityDB {
	private static ParityDB db;
	private String fileName = "db/parity.db";

	public ParityDB() {
		try {
			// Load the SQLite Drivers.
			Class.forName("org.sqlite.JDBC");
		} catch (Exception e) {

		}
	}

	public static ParityDB getInstance() {
		if (db == null) {
			db = new ParityDB();
		}
		return db;
	}

	public Connection getConn() {
		try {
			// Create Connection Object to SQLite Database
			return DriverManager.getConnection("jdbc:sqlite:" + fileName);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println();
		}
		return null;
	}
}
